﻿package reverse

import "fmt"

func Reverse(a string) string {
    length := len(a)
    var result string
    fmt.Printf("%T\n", a[1])  // a[1]的类型是byte
    fmt.Printf("%T\n", a[1:1+1])  // a[1:1+1]是1个字符的字符串
    for i := length-1; i >= 0 ; i-- {
        //result += string(a[i])  // 用a[i]的话还要转类型
        result += a[i:i+1]
    }
    return result
}